package com.mtsmda.chapter7.equalsAndHashCode;

public class Run {

	public static void main(String[] args) {

		FootballClub clubBarcelona = new FootballClub();
		clubBarcelona.setClubName("Barcelona");
		clubBarcelona.setTheBestPlayer("Messi");
		FootballClub clubSpartak = new FootballClub();
		clubSpartak.setClubName("Barcelona");// .setClubName("Spartak");
		clubSpartak.setTheBestPlayer("Messi");// .setTheBestPlayer("Messi");

		System.out.println(clubBarcelona.equals(clubSpartak));
		System.out.println(clubBarcelona == clubSpartak);
		System.out.println(clubBarcelona.hashCode());
		System.out.println(clubSpartak.hashCode());

		clubSpartak.setClubName("Spartak");
		clubSpartak.setTheBestPlayer("Messi");
		System.out.println(clubBarcelona.hashCode());
		System.out.println(clubSpartak.hashCode());
	}

}